How to Dynamically Pass Variables in JavaScript Regular Expressions